<?php


namespace app\common\enum;


class OrderRefundEnum
{
    //操作人类型
    const TYPE_SYSTEM   = 1;//系统
    const TYPE_ADMIN    = 2;//后台
    const TYPE_USER     = 3;//用户

    //退款状态
    const STATUS_ING        = 0;//退款中
    const STATUS_SUCCESS    = 1;//退款成功
    const STATUS_FAIL       = 2;//退款失败


    /**
     * @notes 操作人
     * @param bool $value
     * @return string|string[]
     * @author ljj
     * @date 2022/2/11 2:17 下午
     */
    public static function getOperatorDesc($value = true)
    {
        $desc = [
            self::TYPE_SYSTEM           => '系统',
            self::TYPE_ADMIN            => '后台',
            self::TYPE_USER             => '用户',
        ];

        if (true === $value) {
            return $desc;
        }
        return $desc[$value];
    }


    /**
     * @notes 退款状态
     * @param bool $value
     * @return string|string[]
     * @author ljj
     * @date 2022/9/8 6:45 下午
     */
    public static function getStatusDesc($value = true)
    {
        $desc = [
            self::STATUS_ING                => '退款中',
            self::STATUS_SUCCESS            => '退款成功',
            self::STATUS_FAIL               => '退款失败',
        ];

        if (true === $value) {
            return $desc;
        }
        return $desc[$value];
    }
}